<?php

class AboutAction extends CommonAction
{

    public function _initialize() {
        parent::_initialize();
        C('LAYOUT_NAME', 'Layout/columns-left');
    }

    public function index() {
        $art = M('Article');
        $navs = $art->where('category_id = 3')->order('article_id asc')->select();
        $this->assign('navs', $navs);
        $id = $this->_get('id');
        if($id) {
        	foreach($navs as $nav) {
        		if($nav['article_id'] == $id) {
        			$item = $nav;
        			break;
        		}
        	}
        } else {
        	$item = $navs[0];
        }
        $this->assign('item', $item);
        $this->display('index');
    }

}